e45b10365568185d0fd22546a4b666fa77dea7a9,hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/dancing/DistributedPentomino.java,DistributedPentomino,run,#String[]#,167

Before Change



    Configuration conf = getConf();
    int width = conf.getInt(Pentomino.WIDTH, PENT_WIDTH);
    int height = conf.getInt(Pentomino.HEIGHT, PENT_HEIGHT);
    int depth = conf.getInt(Pentomino.DEPTH, PENT_DEPTH);
    Class<? extends Pentomino> pentClass = conf.getClass(Pentomino.CLASS, 
      OneSidedPentomino.class, Pentomino.class);

After Change


    int width = PENT_WIDTH;
    int height = PENT_HEIGHT;
    int depth = PENT_DEPTH;
    for (int i = 0; i < args.length; i++) {
      if (args[i].equalsIgnoreCase("-depth")) {
          depth = Integer.parseInt(args[i++].trim());
      } else if (args[i].equalsIgnoreCase("-height")) {
	  height = Integer.parseInt(args[i++].trim());
      } else if (args[i].equalsIgnoreCase("-width") ) {
	  width = Integer.parseInt(args[i++].trim()); 
      }
    }
    // now set the values within conf for M/R tasks to read, this
    // will ensure values are set preventing MAPREDUCE-4678
    conf.setInt(Pentomino.WIDTH, width);
    conf.setInt(Pentomino.HEIGHT, height);
    conf.setInt(Pentomino.DEPTH, depth);
    Class<? extends Pentomino> pentClass = conf.getClass(Pentomino.CLASS, 
      OneSidedPentomino.class, Pentomino.class);